home *** CD-ROM | disk | FTP | other *** search
- txtSearch.restrict = "A-Z a-z 0-9 ";
- var aSearchData = new Array();
- getList = function()
- {
- oList.clearList();
- var _loc2_ = 0;
- var _loc4_ = new Array();
- var _loc3_ = new String();
- getKeyWords = function()
- {
- return txtSearch.text.split(" ");
- };
- _loc4_ = getKeyWords();
- i = 0;
- while(i < aGlossaryData.length)
- {
- _loc3_ = aGlossaryData[i][0];
- j = 0;
- while(j < _loc4_.length)
- {
- if(_loc3_.toLowerCase().indexOf(_loc4_[j].toLowerCase()) > -1)
- {
- aSearchData[_loc2_] = new Array(2);
- aSearchData[_loc2_][0] = _loc3_;
- aSearchData[_loc2_][1] = aGlossaryData[i][1];
- oList.addToList(_loc3_);
- _loc2_ = _loc2_ + 1;
- break;
- }
- j++;
- }
- i++;
- }
- oScroller0.setScrollBar(this.oList.oListContainer,420,(_loc2_ - 1) * 30.3);
- };
- var i = 0;
- var aGlossaryItem = new XMLNode();
- var aGlossaryData = new Array();
- var oXML = new XML();
- oXML.ignoreWhite = true;
- oXML.onLoad = function(bOK)
- {
- if(bOK)
- {
- for(i in this.firstChild.childNodes)
- {
- aGlossaryData[i] = new Array(2);
- aGlossaryItem = this.firstChild.childNodes[i];
- aGlossaryData[i][0] = aGlossaryItem.childNodes[0].firstChild.nodeValue;
- aGlossaryData[i][1] = aGlossaryItem.childNodes[1].firstChild.nodeValue;
- }
- aGlossaryData.sort(Array.CASEINSENSITIVE);
- getList();
- }
- };
- oXML.load("gdb.xml");
- loadBody = function(iID)
- {
- txtTitle.text = aSearchData[iID - 1][0];
- txtBody.text = aSearchData[iID - 1][1];
- };
- oBttn.onPress = function()
- {
- getList();
- };
- txtSearch.onKeyUp = function()
- {
- oBttn.onPress();
- };
- Key.addListener(txtSearch);
- txtSearch.onMouseDown = function()
- {
- var _loc1_ = new TextFormat();
- _loc1_.color = 16763904;
- txtSearch.backgroundColor = 16763904;
- txtSearch.setTextFormat(_loc1_);
- };
- Mouse.addListener(txtSearch);
- txtSearch.onSetFocus = function()
- {
- };
-